SPB Git

Repository Public

page.tsx 3.8 KB 79 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : ORIX App Universe8 * File             : src/app/[locale]/apps/page.tsx9 * Module           : app10 * Repository       : https://git.spboucher.ai/orix-spboucher-ai11 * Project Website  : https://www.orixlab.dev12 * Created          : 2026-11-2113 * Last Modified    : 2026-11-2114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: support@spboucher.ai23 * Development      : dev@spboucher.ai24 * Support          : support@spboucher.ai25 * Security/Admin   : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License          : None specified (no license file in this repository)34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243import type { Metadata } from "next";44import { Catalog } from "@/components/catalog/Catalog";45import { AppCard } from "@/components/apps/AppCard";46import { dict, isLocale, type Locale } from "@/lib/i18n";47import { alternates } from "@/lib/seo";48import { cards } from "@/lib/view";49import type { CatalogQuery } from "@/models/filter";5051export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {52  const { locale } = await params; const t = dict(locale as Locale);53  return { title: t.catalog.title, description: t.catalog.lead, alternates: alternates("/apps", locale as Locale) };54}5556export default async function AppsPage({ params, searchParams }: { params: Promise<{ locale: string }>; searchParams: Promise<Record<string, string | undefined>> }) {57  const { locale: raw } = await params; const sp = await searchParams;58  const locale: Locale = isLocale(raw) ? raw : "en";59  const t = dict(locale);60  const apps = cards(locale);61  const initial = { q: sp.q ?? "", platform: sp.platform ?? "", category: sp.category ?? "", status: sp.status ?? "", sort: sp.sort ?? "featured" } as CatalogQuery;62  return (63    <div className="wrap wrap-wide pb-10 pt-32 sm:pt-40">64      <p className="eyebrow">ORIX</p>65      <h1 className="h1 mt-5">{t.catalog.title}</h1>66      <p className="lead mt-4">{t.catalog.lead}</p>67      <div className="mt-10">68        <Catalog apps={apps} initial={initial}69          cardsBySlug={Object.fromEntries(apps.map((a, i) => [a.slug, <AppCard key={a.slug} app={a} locale={locale} priority={i < 3} heading="h2" />]))}70          labels={{71            search: t.catalog.search, searchPlaceholder: t.catalog.searchPlaceholder, platform: t.catalog.platform, category: t.catalog.category, status: t.catalog.status, sort: t.catalog.sort,72            any: t.catalog.any, universal: t.catalog.universal, none: t.catalog.none, reset: t.catalog.reset, sorts: t.catalog.sorts, platforms: t.platforms, categories: t.categories, statuses: t.status,73            resultsOne: t.catalog.results(1).replace("1", "{n}"), resultsMany: t.catalog.results(2).replace("2", "{n}"), forDevice: t.catalog.forDevice("{d}"), listLabel: t.catalog.title,74          }} />75      </div>76    </div>77  );78}79
Files main
Menu

Theme